<html>
<head>
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.1.min.js"></script>
	<script type="text/javascript">
		//var post_url = "http://192.168.218.105:3000/huanghuisong/account/api";
		//var get_url = "http://192.168.218.105:3000/huanghuisong/test/get?userName=huanghuisong&passWord=123456";
		// {"userName":"huanghuisong","passWord":"123456"}
		$(document).ready(function(){
			//post请求
			$("#btnpost").click(function(){
			 var post_url = $("#post_url").val();
			 var post_body = $("#post_body").val();
			 post_body = JSON.parse(post_body);
			  $.post(post_url,post_body,function(data,status){
			  	var data = JSON.stringify(data);
			  	$('#resp').val(data);
			  },"json");
			});
			//get请求
			$("#btnget").click(function(){
			  var get_url = $("#input_get").val()
			  $.get(get_url,function(data,status){
			    $('#resp').val(JSON.stringify(data));
			  });
			});
		});
	</script>
</head>
<body>
	<div>
		<div style="width: 40%;height: auto;float: left;">
			<button type="button" id="btnpost" style="color: gree;font-size:18px;text-align: center;margin-top: 50px;background-color: #11EEEE;height: 40px;width: 90px;">post</button>

			<div>
				url: <input type="" id="post_url" name="" style="width: 400px;height: 30px;margin-top: 10px;margin-left: 18px;" value="http://192.168.218.105:3000/huanghuisong/test/post">
			</div>

			<div>
				<p>body:</p>
				<textarea type="" id="post_body" name=""{userName:"huanghuisong",passWord:"123456"} style="width: 300px;height: 100px;margin-left: 46px">{"userName":"huanghuisong","passWord":"12346"}</textarea>
			</div>
		</div>



		<div style="float: left;height: auto;">
			<div>
				<button type="button" id="btnget" style="color: gree;font-size:18px;text-align: center;margin-top: 20px;background-color: #11EEEE;margin-top: 50px;height: 40px;width: 90px;">get
				</button>
			</div>

			<div>
				url: <input type="" id="input_get" name="" style="width: 600px;height: 30px;margin-top: 10px;margin-left: 18px;" value="http://192.168.218.105:3000/huanghuisong/test/get?userName=huanghuisong&passWord=123456">
			</div>
		</div>


		<div  style="height: 100px;width: 1000px;">
			<textarea id="resp" style="margin-top: 30px;width: 600px;height: 200px;margin-left: 40%;color: #6666cc;text-align: center;">

			</textarea>

		<div>
	</div>
</body>
</html>










